package com.jf.cloud.multishop.bo.mongo;

import io.swagger.v3.oas.annotations.media.Schema;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.index.CompoundIndex;
import org.springframework.data.mongodb.core.index.CompoundIndexes;
import org.springframework.data.mongodb.core.mapping.Document;

import java.util.Date;

/**
 * 对应MongoDB存储商家余额日志emp
 * @author 菠萝凤梨
 */
@Document("shop_wallet_log")
@CompoundIndexes({
        @CompoundIndex(name = "id_idx", def = "{'walletLogId':1}", unique = true),
        @CompoundIndex(name = "shopId_reason_idx", def = "{'shopId':1, 'reason':1}")
})
public class MongoShopWalletLogBO {

    @Id
    @Schema(description = "店铺钱包id" )
    private Long walletLogId;

    @Schema(description = "店铺id" , required = true)
    private Long shopId;

    @Schema(description = "关联订单id" )
    private Long orderId;

    @Schema(description = "关联退款单id" )
    private Long refundId;

    @Schema(description = "关联的钱包分片数 可能为空" )
    private Integer zoneNo;

    @Schema(description = "商家收支类型 0支出 1收入" )
    private Integer shopIoType;

    @Schema(description = "平台收支类型 0支出 1收入" )
    private Integer platformIoType;

    @Schema(description = "金额类型 0 未结算金额 1可提现金额 2冻结金额" , required = true)
    private Integer amountType;

    @Schema(description = "商家改变金额" )
    private Long shopChangeAmount;

    @Schema(description = "平台改变金额" )
    private Long platformChangeAmount;

    @Schema(description = "原因 ShopWalletChangeReason" , required = true)
    private Integer reason;

    @Schema(description = "用户金额（支付实付金额，退款实际申请金额）" , required = true)
    private Long userAmount;

    @Schema(description = "平台补贴金额" , required = true)
    private Long platformAmount;

    @Schema(description = "分销占用金额" , required = true)
    private Long distributionAmount;

    @Schema(description = "商家的平台佣金" , required = true)
    private Long shopPlatformCommission;

    @Schema(description = "平台佣金" , required = true)
    private Long platformCommission;

    @Schema(description = "商家优惠金额" , required = true)
    private Long shopReduceAmount;

    @Schema(description = "创建时间" , required = true)
    private Date createTime;

    @Schema(description = "更新时间" )
    private Date updateTime;

    @Schema(description = "店铺名称" )
    private String shopName;

    public Long getWalletLogId() {
        return walletLogId;
    }

    public void setWalletLogId(Long walletLogId) {
        this.walletLogId = walletLogId;
    }

    public Long getShopId() {
        return shopId;
    }

    public void setShopId(Long shopId) {
        this.shopId = shopId;
    }

    public Long getOrderId() {
        return orderId;
    }

    public void setOrderId(Long orderId) {
        this.orderId = orderId;
    }

    public Long getRefundId() {
        return refundId;
    }

    public void setRefundId(Long refundId) {
        this.refundId = refundId;
    }

    public Integer getZoneNo() {
        return zoneNo;
    }

    public void setZoneNo(Integer zoneNo) {
        this.zoneNo = zoneNo;
    }

    public Integer getShopIoType() {
        return shopIoType;
    }

    public void setShopIoType(Integer shopIoType) {
        this.shopIoType = shopIoType;
    }

    public Integer getPlatformIoType() {
        return platformIoType;
    }

    public void setPlatformIoType(Integer platformIoType) {
        this.platformIoType = platformIoType;
    }

    public Integer getAmountType() {
        return amountType;
    }

    public void setAmountType(Integer amountType) {
        this.amountType = amountType;
    }

    public Long getShopChangeAmount() {
        return shopChangeAmount;
    }

    public void setShopChangeAmount(Long shopChangeAmount) {
        this.shopChangeAmount = shopChangeAmount;
    }

    public Long getPlatformChangeAmount() {
        return platformChangeAmount;
    }

    public void setPlatformChangeAmount(Long platformChangeAmount) {
        this.platformChangeAmount = platformChangeAmount;
    }

    public Integer getReason() {
        return reason;
    }

    public void setReason(Integer reason) {
        this.reason = reason;
    }

    public Long getUserAmount() {
        return userAmount;
    }

    public void setUserAmount(Long userAmount) {
        this.userAmount = userAmount;
    }

    public Long getPlatformAmount() {
        return platformAmount;
    }

    public void setPlatformAmount(Long platformAmount) {
        this.platformAmount = platformAmount;
    }

    public Long getDistributionAmount() {
        return distributionAmount;
    }

    public void setDistributionAmount(Long distributionAmount) {
        this.distributionAmount = distributionAmount;
    }

    public Long getShopPlatformCommission() {
        return shopPlatformCommission;
    }

    public void setShopPlatformCommission(Long shopPlatformCommission) {
        this.shopPlatformCommission = shopPlatformCommission;
    }

    public Long getPlatformCommission() {
        return platformCommission;
    }

    public void setPlatformCommission(Long platformCommission) {
        this.platformCommission = platformCommission;
    }

    public Long getShopReduceAmount() {
        return shopReduceAmount;
    }

    public void setShopReduceAmount(Long shopReduceAmount) {
        this.shopReduceAmount = shopReduceAmount;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    public String getShopName() {
        return shopName;
    }

    public void setShopName(String shopName) {
        this.shopName = shopName;
    }

    @Override
    public String toString() {
        return "MongoShopWalletLogBO{" +
                "walletLogId=" + walletLogId +
                ", shopId=" + shopId +
                ", orderId=" + orderId +
                ", refundId=" + refundId +
                ", zoneNo=" + zoneNo +
                ", shopIoType=" + shopIoType +
                ", platformIoType=" + platformIoType +
                ", amountType=" + amountType +
                ", shopChangeAmount=" + shopChangeAmount +
                ", platformChangeAmount=" + platformChangeAmount +
                ", reason=" + reason +
                ", userAmount=" + userAmount +
                ", platformAmount=" + platformAmount +
                ", distributionAmount=" + distributionAmount +
                ", shopPlatformCommission=" + shopPlatformCommission +
                ", platformCommission=" + platformCommission +
                ", shopReduceAmount=" + shopReduceAmount +
                ", createTime=" + createTime +
                ", updateTime=" + updateTime +
                ", shopName='" + shopName + '\'' +
                '}';
    }
}
